<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <!-- 设置页面的 基本路径，页面所有资源引入和页面的跳转全部基于 base路径 -->
    <base th:href="${#request.getContextPath()}+'/'">
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,doctor-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="Bookmark" href="/favicon.ico">
    <link rel="Shortcut Icon" href="/favicon.ico"/>

    <script type="text/javascript" th:src="@{/lib/html5shiv.js}"></script>
    <script type="text/javascript" th:src="@{/lib/respond.min.js}"></script>


    <link rel="stylesheet" type="text/css" th:href="@{/h-ui/css/H-ui.min.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/h-ui.admin/css/H-ui.admin.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/lib/Hui-iconfont/1.0.8/iconfont.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/h-ui.admin/skin/default/skin.css}" id="skin"/>
    <link rel="stylesheet" type="text/css" th:href="@{/h-ui.admin/css/style.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/lib/bootstrap/css/bootstrap.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/lib/bootstrap-table/bootstrap-table.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css}"/>


    <script type="text/javascript" th:src="@{/lib/DD_belatedPNG_0.0.8a-min.js}"></script>
    <script>DD_belatedPNG.fix('*');</script>

    <title>修改排班</title>
</head>
<body>
<article class="page-container">
    <form class="form form-horizontal"
          th:action="${doctorScheduling eq null }  ?'doctorScheduling/insert':'doctorScheduling/update'" method="post"
          id="form-doctorScheduling-edit">
        <input type="hidden" id="schedulingId" value="" name="schedulingId"
               th:value=" ${doctorScheduling?.schedulingId}">
        <div class="row cl">
            <label class="form-label col-xs-2 col-sm-1">用户名：</label>
            <div class="formControls col-xs-8 col-sm-6">
                <input type="text" class="input-text" th:value="${doctorScheduling?.username}"
                       th:disabled="${doctorScheduling ne null}?'true'" id="username" name="username">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-2 col-sm-1">周一：</label>
            <div class="formControls col-xs-8 col-sm-6">
                <input type="text" class="input-text" th:value="${doctorScheduling?.monWork}"
                       id="monWork" name="monWork">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-2 col-sm-1">周二：</label>
            <div class="formControls col-xs-8 col-sm-6">
                <input type="text" class="input-text" th:value="${doctorScheduling?.tueWork}"
                       id="tueWork" name="tueWork">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-2 col-sm-1">周三：</label>
            <div class="formControls col-xs-8 col-sm-6">
                <input type="text" class="input-text" th:value="${doctorScheduling?.webWork}"
                       id="webWork" name="webWork">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-2 col-sm-1">周四：</label>
            <div class="formControls col-xs-8 col-sm-6">
                <input type="text" class="input-text" th:value="${doctorScheduling?.thuWork}"
                       id="thuWork" name="thuWork">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-2 col-sm-1">周五：</label>
            <div class="formControls col-xs-8 col-sm-6">
                <input type="text" class="input-text" th:value="${doctorScheduling?.friWork}"
                       id="friWork" name="friWork">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-2 col-sm-1">周六：</label>
            <div class="formControls col-xs-8 col-sm-6">
                <input type="text" class="input-text" th:value="${doctorScheduling?.satWork}"
                       id="satWork" name="satWork">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-2 col-sm-1">周日：</label>
            <div class="formControls col-xs-8 col-sm-6">
                <input type="text" class="input-text" th:value="${doctorScheduling?.sunWork}"
                       id="sunWork" name="sunWork">
            </div>
        </div>

        <div class="row cl">
            <div class="col-xs-12 col-sm-12 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
            </div>
        </div>
    </form>


</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" th:src="@{/lib/jquery/1.11.3/jquery.min.js}"></script>
<script type="text/javascript" th:src="@{/lib/jquery.validation/1.14.0/jquery.validate.js}"></script>
<script type="text/javascript" th:src="@{/lib/jquery.validation/1.14.0/messages_zh.js}"></script>
<script type="text/javascript" th:src="@{/lib/jquery.validation/1.14.0/validate-methods.js}"></script>
<script type="text/javascript" th:src="@{/lib/layer/2.4/layer.js}"></script>
<script type="text/javascript" th:src="@{/h-ui/js/H-ui.min.js}"></script>
<script type="text/javascript" th:src="@{/h-ui.admin/js/H-ui.admin.js}"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" th:src="@{/lib/My97DatePicker/4.8/WdatePicker.js}"></script>
<script type="text/javascript" th:src="@{/lib/datatables/1.10.0/jquery.dataTables.min.js}"></script>
<script type="text/javascript" th:src="@{/lib/bootstrap-table/bootstrap-table.js}"></script>
<script type="text/javascript" th:src="@{/lib/bootstrap-table/bootstrap-table-zh-CN.min.js}"></script>

<!--业务-->
<script type="text/javascript">
    $(function () {
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form-doctorScheduling-edit").validate({
            rules: {
                username: {
                    required: true
                },
                monWork: {
                    required: true
                },
                tueWork: {
                    required: true
                },
                webWork: {
                    required: true
                },
                thuWork: {
                    required: true
                },
                friWork: {
                    required: true
                },
                satWork: {
                    required: true
                },
                sunWork: {
                    required: true
                }
            },
            success: "valid",
            messages: {
                username: {
                    required: "用户名不能为空"
                },
                monWork: {
                    required: "工作不能为空"
                },
                tueWork: {
                    required: "工作不能为空"
                },
                webWork: {
                    required: "工作不能为空"
                },
                thuWork: {
                    required: "工作不能为空"
                },
                friWork: {
                    required: "工作不能为空"
                },
                satWork: {
                    required: "工作不能为空"
                },
                sunWork: {
                    required: "工作不能为空"
                }
            },
            submitHandler: function (form) {
                $(form).ajaxSubmit(function (data) {
                    layer.msg(data.msg, {icon: data.code, time: 1000}, function () {
                        //操作成功刷新数据
                        if (data.code == 1) {

                            //刷新父页面表格
                            parent.refresh();
                            //关闭窗口
                            parent.layer.closeAll();
                        }
                    });
                });
            }
        });

        /*医生擅长，医生描述动态显示*/
        var doctor = $("#doctorId").val();
        console.log(doctor)
        if (doctor == "") {
            $("#doctor-expert").css("display", "none");
            $("#doctor-desc").css("display", "none");

        } else {
            $("#doctor-expert").css("display", "block");
            $("#doctor-desc").css("display", "block");

        }

    });

</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>